package com.hoo.service.flow;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hoo.entity.flow.FlowUserAction;
import com.hoo.mapper.flow.FlowUserActionMapper;
import com.hoo.util.PaginationSupport;

@Service
public class FlowUserActionService {
	@Autowired
	FlowUserActionMapper flowUserActionMapper;
	
	public void insert_flow_user_action(FlowUserAction flow){
		this.flowUserActionMapper.insertSelective(flow);
	}
	
	public PaginationSupport<FlowUserAction> search(Integer userId) {
        int totalCount = this.flowUserActionMapper.getUserActionCount(userId);
        List<FlowUserAction> list =this.getUserActionList(userId);
        return new PaginationSupport(list, totalCount, 20,0);
    }
	
    public List<FlowUserAction> getUserActionList(Integer userId) {
        return this.flowUserActionMapper.getUserActionList(userId);
    }
}
